
package Controller;

import Model.Associacao;
import Model.BD.DAO;

import com.icesoft.faces.component.jsfcl.data.DefaultSelectionItems;
import java.util.*;
import javax.faces.model.SelectItem;

/**
 *
 * @author BBG
 */
public class AssociacaoBO
{
    public DAO<Associacao> getDAO()
    {
        return new DAO <Associacao>(Associacao.class);
    }

    public DefaultSelectionItems montaLista(List <Associacao> lista)
    {
        DefaultSelectionItems itens = new DefaultSelectionItems();
        itens.clear();
        int i=0;
        while(i<lista.size())
         {
            itens.add(new SelectItem(lista.get(i).getCodAssociacao(),lista.get(i).getNome()));
            i++;
         }
        return itens;
    }

}
